package com.yand.bwda;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.io.File;
import java.util.List;

public class XmlUtils {

    /**
     * 根据xml文件路径解析具体的漏洞报文对象
     * @param xmlFilePath
     * @return
     */
    public static Report parseXmlToBean(String xmlFilePath) throws DocumentException {
        Report report = Report.builder().build();
        SAXReader reader = new SAXReader();
        Document document = reader.read(new File(xmlFilePath));
        Element rootElm = document.getRootElement();
        Element taskelement = rootElm.element("data").element("report").element("task");


        return report;
    }

}
